package com.bjypc.youth.service.impl;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.transaction.annotation.Transactional;

import com.bjypc.youth.dao.IAdultPersonDao;
import com.bjypc.youth.entity.AdultPerson;
import com.bjypc.youth.entity.FutureJudgment;
import com.bjypc.youth.entity.ImportentLevel;
import com.bjypc.youth.entity.InterpersonalRelationship;
import com.bjypc.youth.entity.LifeStyle;
import com.bjypc.youth.entity.PersonAssociation;
import com.bjypc.youth.entity.PersonConsume;
import com.bjypc.youth.entity.PersonalFeeling;
import com.bjypc.youth.entity.PersonalInterest;
import com.bjypc.youth.entity.StudentConsume;
import com.bjypc.youth.entity.TimeUsing;
import com.bjypc.youth.service.BaseAbstractService;
import com.bjypc.youth.service.IAdultPersonService;
import com.bjypc.youth.util.BjyouthConstants;

/**
 * AdultService
 * 
 * @author chenzwei
 * 
 */
@Transactional
public class AdultPersonServiceImpl extends BaseAbstractService implements
		IAdultPersonService {
	private IAdultPersonDao adultPersonDao;

	public AdultPerson find(Long id) {
		return this.adultPersonDao.findById(id);
	}

	public List<AdultPerson> findAll() {
		return this.adultPersonDao.findAll();
	}

	public void remove(Long id) {
		this.adultPersonDao.removeById(id);

	}

	public void save(AdultPerson person) {
		this.adultPersonDao.save(person);
	}

	public IAdultPersonDao getAdultPersonDao() {
		return adultPersonDao;
	}

	public void setAdultPersonDao(IAdultPersonDao adultPersonDao) {
		this.adultPersonDao = adultPersonDao;
	}

	public HSSFWorkbook export(List<AdultPerson> dataList) {
		HSSFWorkbook workbook = null;
		try {
			// 这里的数据即时你要从后台取得的数据

			// 创建工作簿实例
			workbook = new HSSFWorkbook();
			// 创建工作表实例
			HSSFSheet sheet = workbook.createSheet("Test Result");
			// 设置列宽
			this.setSheetColumnWidth(sheet);
			// 获取样式
			HSSFCellStyle style = this.createTitleStyle(workbook);

			//
			if (dataList != null && dataList.size() > 0) {
				// 创建第一行标题,标题名字的本地信息通过resources从资源文件中获取
				HSSFRow row = sheet.createRow(0);// 建立新行
				createTitleRow(row, style);

				// 给excel填充数据
				int i = 0;
				for (AdultPerson person : dataList) {
					i++;

					// 将dataList里面的数据取出来，假设这里取出来的是Model,也就是某个javaBean的意思啦
					HSSFRow row1 = sheet.createRow((short) (i));// 建立新行
					createTextCell(row1, 0, style,
							BjyouthConstants.SexNames[person.getSex()]);
					createTextCell(row1, 1, style, person.getBirth());
					createTextCell(row1, 2, style, person.getEducation());
					createTextCell(row1, 3, style, person.getMajoring());
					createTextCell(row1, 4, style, person.getProfession());
					createTextCell(row1, 5, style, person.getWorkIncome());
					createTextCell(row1, 6, style, person.getOtherIncome());
					createTextCell(row1, 7, style, BjyouthConstants
							.yesOrNot(person.isLiveWithParent()));
					createTextCell(row1, 8, style, person.getLiveAddress());
					createTextCell(row1, 9, style, getLiveWith(person));
					// Lifestyle,10-26
					LifeStyle lifeStyle = person.getLifeStyle();
					createNumCell(row1, 10, style, lifeStyle.getShareData());
					createNumCell(row1, 11, style, lifeStyle.getEatLessForFat());
					createNumCell(row1, 12, style, lifeStyle.getLiar());
					createNumCell(row1, 13, style, lifeStyle.getDrinkOnemore());
					createNumCell(row1, 14, style, lifeStyle.getShareLiking());
					createNumCell(row1, 15, style, lifeStyle.getHelping());
					createNumCell(row1, 16, style, lifeStyle.getCheating());
					createNumCell(row1, 17, style, lifeStyle.getSmokeMore());
					createNumCell(row1, 18, style, lifeStyle.getSurfLong());
					createNumCell(row1, 19, style, lifeStyle
							.getTeamCollaborate());
					createNumCell(row1, 20, style, lifeStyle.getJokeOthers());
					createNumCell(row1, 21, style, lifeStyle.getHelpShy());
					createNumCell(row1, 22, style, lifeStyle.getShareFeeling());
					createNumCell(row1, 23, style, lifeStyle.getDiscussEvent());
					createNumCell(row1, 24, style, lifeStyle.getCoHardTask());
					createNumCell(row1, 25, style, lifeStyle
							.getAbsentWithReason());
					createNumCell(row1, 26, style, lifeStyle
							.getHelpDifficutyStudies());
					// Relationship,27-45
					InterpersonalRelationship relationship = person
							.getInterpersonalRelationship();
					createCell(row1, 27, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getAttractingTogether());
					createCell(row1, 28, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getSelfIntroduce());
					createCell(row1, 29, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getWishGoodFirstImage());
					createCell(row1, 30, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getUnfamilierParty());
					createCell(row1, 31, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getTellUnlike());
					createCell(row1, 32, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getPersistRight());
					createCell(row1, 33, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getTellDiscomfiture());
					createCell(row1, 34, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getShowWeak());
					createCell(row1, 35, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getTrustFrient());
					createCell(row1, 36, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getTellSecret());
					createCell(row1, 37, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getTellAppreciateLevel());
					createCell(row1, 38, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getPatientListen());
					createCell(row1, 39, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getCatchFit());
					createCell(row1, 40, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getSupportFrient());
					createCell(row1, 41, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getShowSincety());
					createCell(row1, 42, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getNoRage());
					createCell(row1, 43, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getListenBoring());
					createCell(row1, 44, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getNoAccuse());
					createCell(row1, 45, style, HSSFCell.CELL_TYPE_STRING,
							relationship.getAcceptFitPoint());
					// 46-63人际关系（二）
					PersonAssociation association = person
							.getPersonAssociation();
					createNumCell(row1, 46, style, association
							.getButtingWithLeader());
					createNumCell(row1, 47, style, association
							.getAlignWithOthers());
					createNumCell(row1, 48, style, association
							.getTellVexToFriends());
					createNumCell(row1, 49, style, association
							.getCarefulDeclare());
					createNumCell(row1, 50, style, association
							.getLitteCommunityWithLeader());
					createNumCell(row1, 51, style, association
							.getLeadersNoUnderstanding());
					createNumCell(row1, 52, style, association
							.getWillingCommunicateAll());
					createNumCell(row1, 53, style, association
							.getLittleRequireFromParent());
					createNumCell(row1, 54, style, association
							.getLeadersBlames());
					createNumCell(row1, 55, style, association
							.getNotCareTickets());
					createNumCell(row1, 56, style, association
							.getActiveGreeting());
					createNumCell(row1, 57, style, association
							.getOnwellWithParent());
					createNumCell(row1, 58, style, association.getMailForMiss());
					createNumCell(row1, 59, style, association
							.getInterestingWithFamilies());
					createNumCell(row1, 60, style, association
							.getCloseTiesFamily());
					createNumCell(row1, 61, style, association
							.getConcernEverySide());
					createNumCell(row1, 62, style, association
							.getUpsetLongtimeForLate());
					createNumCell(row1, 63, style, association
							.getLikeExpressViews());
					// PersonInterest,64-79
					PersonalInterest interest = person.getPersonalInterest();

					createNumCell(row1, 64, style, interest.getLikePolitics());
					createNumCell(row1, 65, style, interest.getLikeStudying());
					createNumCell(row1, 66, style, interest.getLikeReading());
					createNumCell(row1, 67, style, interest
							.getLikeArgueEvents());
					createNumCell(row1, 68, style, interest.getLikeExtrabooks());
					createNumCell(row1, 69, style, interest
							.getLikeJoinOrgnize());
					createNumCell(row1, 70, style, interest
							.getLikeOrgnizedSocieties());
					createNumCell(row1, 71, style, interest
							.getLikeCollectCarrerInfo());
					createNumCell(row1, 72, style, interest.getLikeVolunteer());
					createNumCell(row1, 73, style, interest
							.getLikeStudyFamilyTradition());
					createNumCell(row1, 74, style, interest.getLikeArtShow());
					createNumCell(row1, 75, style, interest
							.getLikeReligionActivity());
					createNumCell(row1, 76, style, interest
							.getLikeBuyingHappy());
					createNumCell(row1, 77, style, interest
							.getLikeSportsActivity());
					createNumCell(row1, 78, style, interest.getLikeOutgoing());
					createNumCell(row1, 79, style, interest
							.getLikeBetterDiningroom());

					// PersonConsume,80-93
					PersonConsume consume = person.getPersonConsume();
					createTextCell(row1, 80, style,
							PersonConsume.MoneyFrom[consume.getMoneyFrom()]);
					createNumCell(row1, 81, style, consume.getDepotPct());
					createNumCell(row1, 82, style, consume.getInvestimentPct());
					createNumCell(row1, 83, style, consume.getFunPct());
					createNumCell(row1, 84, style, consume.getHobbyPct());
					createNumCell(row1, 85, style, consume.getMakeupPct());
					createNumCell(row1, 86, style, consume.getAnythingElsePct());
					createTextCell(row1, 87, style, consume
							.getAnythingElseDesc());
					createTextCell(row1, 88, style,
							StudentConsume.BuyShoes[consume.getBuyShoes()]);
					createCell(row1, 89, style, HSSFCell.CELL_TYPE_STRING,
							consume.getConsumeTrouble());
					createCell(row1, 90, style, HSSFCell.CELL_TYPE_STRING,
							BjyouthConstants.yesOrNot(consume
									.isRecordConsumeItem()));
					createCell(row1, 91, style, HSSFCell.CELL_TYPE_STRING,
							BjyouthConstants.yesOrNot(consume.isOrderOnWeb()));
					createCell(row1, 92, style, HSSFCell.CELL_TYPE_STRING,
							consume.getThinkingBeforeConsume());
					createCell(row1, 93, style, HSSFCell.CELL_TYPE_STRING,
							consume.getConsumeStandard());

					// TimeUsing,94-106
					TimeUsing timeUsing = person.getTimeUsing();
					createCell(row1, 94, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getProvideHelp());
					createCell(row1, 95, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getJoinCollectiveActivity());
					createCell(row1, 96, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getSurfingOnNet());
					createCell(row1, 97, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getSkateboardActitity());
					createCell(row1, 98, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getPartTimeJob());
					createCell(row1, 99, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getJobRelated());
					createCell(row1, 100, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getIdling());
					createCell(row1, 101, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getWatchTv());
					createCell(row1, 102, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getPlayEgames());
					createCell(row1, 103, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getWorkWithFamily());
					createCell(row1, 104, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getPlayOtherSports());
					createCell(row1, 105, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getPersonalExercise());
					createCell(row1, 106, style, HSSFCell.CELL_TYPE_STRING,
							timeUsing.getReadingBooks());

					// PersonalFeeling,107-149
					PersonalFeeling feeling = person.getPersonalFeeling();
					createNumCell(row1, 107, style, feeling.getUselessEnergy());
					createNumCell(row1, 108, style, feeling
							.getDoAnythingWanted());
					createNumCell(row1, 109, style, feeling.getLikeMyself());
					createNumCell(row1, 110, style, feeling.getCreative());
					createNumCell(row1, 111, style, feeling.getTrusted());
					createNumCell(row1, 112, style, feeling.getFeelSthBad());
					createNumCell(row1, 113, style, feeling
							.getNothingInteresting());
					createNumCell(row1, 114, style, feeling.getFeelAlone());
					createNumCell(row1, 115, style, feeling.getThoughtShort());
					createNumCell(row1, 116, style, feeling.getDoNothing());
					createNumCell(row1, 117, style, feeling.getNotLoseTemper());
					createNumCell(row1, 118, style, feeling
							.getKeepGoodUnderPress());
					createNumCell(row1, 119, style, feeling
							.getKeepSmoothUnderFrust());
					createNumCell(row1, 120, style, feeling.getSelfMotivate());
					createNumCell(row1, 121, style, feeling.getGoodThinking());
					createNumCell(row1, 122, style, feeling
							.getNothingStopHappy());
					createNumCell(row1, 123, style, feeling
							.getGoodHeartFaceLife());
					createNumCell(row1, 124, style, feeling.getGoodLooking());
					createNumCell(row1, 125, style, feeling.getBeatifulEye());
					createNumCell(row1, 126, style, feeling.getTall());
					createNumCell(row1, 127, style, feeling.getGoodBody());
					createNumCell(row1, 128, style, feeling.getHealthy());
					createNumCell(row1, 129, style, feeling.getLessSick());
					createNumCell(row1, 130, style, feeling.getGoodPopularity());
					createNumCell(row1, 131, style, feeling.getGetOnWell());
					createNumCell(row1, 132, style, feeling.getGoodFellowShip());
					createNumCell(row1, 133, style, feeling.getWellWithParent());
					createNumCell(row1, 134, style, feeling.getWellWithLeader());
					createNumCell(row1, 135, style, feeling.getManyFriends());
					createNumCell(row1, 136, style, feeling.getSelfSatisfied());
					createNumCell(row1, 137, style, feeling.getSelfConfident());
					createNumCell(row1, 138, style, feeling.getSuccessWithTry());
					createNumCell(row1, 139, style, feeling.getDoAsSelfWant());
					createNumCell(row1, 140, style, feeling.getBroadLike());
					createNumCell(row1, 141, style, feeling.getLikeDancing());
					createNumCell(row1, 142, style, feeling.getLikeArt());
					createNumCell(row1, 143, style, feeling.getLeaderInGames());
					createNumCell(row1, 144, style, feeling.getNoPublicTide());
					createNumCell(row1, 145, style, feeling.getNoPublicOrder());
					createNumCell(row1, 146, style, feeling
							.getSavePublicTreasureFirst());
					createNumCell(row1, 147, style, feeling
							.getDoInterestedOnly());
					createNumCell(row1, 148, style, feeling
							.getPersonDevelopImportent());
					createNumCell(row1, 149, style, feeling.getUnitObeyGroup());
					// 重要性判断，150-156
					ImportentLevel importentLevel = person.getImportentLevel();
					createNumCell(row1, 150, style, importentLevel
							.getFreeControlSpareTime());
					createNumCell(row1, 151, style, importentLevel
							.getWorkGood());
					createNumCell(row1, 152, style, importentLevel
							.getConsiderdGoodWorker());
					createNumCell(row1, 153, style, importentLevel
							.getFreeControlMoney());
					createNumCell(row1, 154, style, importentLevel
							.getCanPromote());
					createNumCell(row1, 155, style, importentLevel
							.getMakePlan());
					createNumCell(row1, 156, style, importentLevel
							.getFindIdealLove());

					// 未来判断，157-163
					FutureJudgment futureJudgment = person.getFutureJudgment();
					createCell(row1, 157, style, HSSFCell.CELL_TYPE_STRING,
							futureJudgment.getFindGoodJob());
					createCell(row1, 158, style, HSSFCell.CELL_TYPE_STRING,
							futureJudgment.getGetGoodStation());
					createCell(row1, 159, style, HSSFCell.CELL_TYPE_STRING,
							futureJudgment.getWorkFavorite());
					createCell(row1, 160, style, HSSFCell.CELL_TYPE_STRING,
							futureJudgment.getHaveHappyFamily());
					createNumCell(row1, 161, style, futureJudgment
							.getGetRespected());
					createCell(row1, 162, style, HSSFCell.CELL_TYPE_STRING,
							FutureJudgment.ChangeIndustry(futureJudgment
									.isChangeIndustry()));
					createCell(row1, 163, style, HSSFCell.CELL_TYPE_STRING,
							futureJudgment.getWantTodo());

				}
			} else {
				createCell(sheet.createRow(0), 0, style,
						HSSFCell.CELL_TYPE_STRING, "查无资料");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return workbook;
	}

	private String getLiveWith(AdultPerson person) {
		StringBuffer liveWith = new StringBuffer();
		if (person.isLiveWithMother()) {
			liveWith.append("母亲").append("  ");
		}
		if (person.isLiveWithFather()) {
			liveWith.append("父亲").append(" ");
		}
		if (person.isLiveWithFriend()) {
			liveWith.append("男朋友或女朋友").append(" ");
		}
		if (person.isLiveWithGrand()) {
			liveWith.append("爷爷、奶奶或外公、外婆").append(" ");
		}
		if (person.isLiveWithHoney()) {
			liveWith.append("丈夫或妻子").append(" ");
		}
		if (person.isLiveWithBrother()) {
			liveWith.append("亲兄弟或继兄弟").append(" ");
		}
		if (person.isLiveWithSecondFather()) {
			liveWith.append("继父").append(" ");
		}
		if (person.isLiveWithSecondMother()) {
			liveWith.append("继母").append(" ");
		}
		if (person.isLiveWithSecondParent()) {
			liveWith.append("养父母").append(" ");
		}
		if (person.isLiveWithSister()) {
			liveWith.append("亲姐妹或继姐妹").append(" ");
		}

		return liveWith.toString();
	}

	private void createTitleRow(HSSFRow row, HSSFCellStyle style) {
		createTextCell(row, 0, style, "性别");
		createTextCell(row, 1, style, "出生年月");
		createTextCell(row, 2, style, "学历");
		createTextCell(row, 3, style, "专业");
		createTextCell(row, 4, style, "职业");
		createTextCell(row, 5, style, "工作收入");
		createTextCell(row, 6, style, "其他收入");
		createTextCell(row, 7, style, "住在父母家");
		createTextCell(row, 8, style, "家庭住址");
		createTextCell(row, 9, style, "和谁住在一起");

		// 10-26
		for (int j = 0; j < LifeStyle.fieldNames.length; j++) {
			String name = LifeStyle.fieldNames[j];
			int index = 10 + j;
			createTextCell(row, index, style, index + "（二）生活方式-" + name);
		}
		// 27-45人际关系,27+19-1
		for (int j = 0; j < InterpersonalRelationship.fieldNames.length; j++) {
			String name = InterpersonalRelationship.fieldNames[j];
			int index = 27 + j;
			createTextCell(row, index, style, index + "（三）与人交往-" + name);
		}
		// 46-63人际关系（二）,46+18-1
		for (int j = 0; j < PersonAssociation.fieldNames.length; j++) {
			String name = PersonAssociation.fieldNames[j];
			int index = 46 + j;
			createTextCell(row, index, style, index + "（三）与人交往<二>-" + name);
		}

		// 64-79个人兴趣,64+16-1
		for (int j = 0; j < PersonalInterest.fieldNames.length; j++) {
			String name = PersonalInterest.fieldNames[j];
			int index = 64 + j;
			createTextCell(row, index, style, index + "（四）个人兴趣-" + name);
		}
		// 80-93 消费水平,80+14-1
		for (int j = 0; j < PersonConsume.fieldNames.length; j++) {
			String name = PersonConsume.fieldNames[j];
			int index = 80 + j;
			createTextCell(row, index, style, index + "（五）消费水平-" + name);
		}
		// 94-106 时间观念,94+13-1
		for (int j = 0; j < TimeUsing.fieldNames.length; j++) {
			String name = TimeUsing.fieldNames[j];
			int index = 94 + j;
			createTextCell(row, index, style, index + "（六）时间观念-" + name);
		}
		// 107-149感觉感受,107+43-1
		for (int j = 0; j < PersonalFeeling.fieldNames.length; j++) {
			String name = PersonalFeeling.fieldNames[j];
			int index = 107 + j;
			createTextCell(row, index, style, index + "（七）感觉感受-" + name);
		}
		// 150-156重要性判断,150+7-1
		for (int j = 0; j < ImportentLevel.fieldNames.length; j++) {
			String name = ImportentLevel.fieldNames[j];
			int index = 150 + j;
			createTextCell(row, index, style, index + "（八）重要性判断-" + name);
		}
		// 157-163未来判断,157+7-1
		for (int j = 0; j < FutureJudgment.fieldNames.length; j++) {
			String name = FutureJudgment.fieldNames[j];
			int index = 157 + j;
			createTextCell(row, index, style, index + "（九）未来判断-" + name);
		}

	}

	// 创建Excel单元格
	private void createCell(HSSFRow row, int column, HSSFCellStyle style,
			int cellType, Object value) {
		HSSFCell cell = row.createCell(column);

		if (style != null) {
			cell.setCellStyle(style);
		}
		switch (cellType) {
		case HSSFCell.CELL_TYPE_BLANK: {

		}
			break;
		case HSSFCell.CELL_TYPE_STRING: {
			cell.setCellValue(value + "");
		}
			break;
		case HSSFCell.CELL_TYPE_NUMERIC: {
			cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
			// DecimalFormat format = new DecimalFormat("###,##0.00");
			// cell.setCellValue(Float.parseFloat(value.toString()));
			cell.setCellValue(Double.parseDouble(value.toString()));
		}
			break;
		default:
			break;
		}
	}

	private void createTextCell(HSSFRow row, int column, HSSFCellStyle style,
			String value) {
		HSSFCell cell = row.createCell(column);
		cell.setCellStyle(style);
		cell.setCellType(HSSFCell.CELL_TYPE_STRING);
		cell.setCellValue(new HSSFRichTextString(value));
	}

	private void createNumCell(HSSFRow row, int column, HSSFCellStyle style,
			int value) {
		HSSFCell cell = row.createCell(column);
		cell.setCellStyle(style);
		cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
		cell.setCellValue(value);

	}

	// 设置excel的title样式
	private HSSFCellStyle createTitleStyle(HSSFWorkbook wb) {
		HSSFFont boldFont = wb.createFont();
		boldFont.setFontHeight((short) 200);
		HSSFCellStyle style = wb.createCellStyle();
		style.setFont(boldFont);
		style.setDataFormat(HSSFDataFormat.getBuiltinFormat("###,##0.00"));
		return style;
	}

	private void setSheetColumnWidth(HSSFSheet sheet) {
		// 根据你数据里面的记录有多少列，就设置多少列
		for (int i = 0; i < 164; i++) {
			sheet.setColumnWidth(i, 8000);
		}

	}

}
